<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/7/21
 * Time: 14:26
 */
header("Content-Type: text/plain;charset=utf-8");
header("Access-Control-Allow-Origin:*");
header("Access-Control-Methods:POST,GET");

require_once('../com/dao/suggDao.php');
require_once('../com/dao/respDao.php');

//查询建言
$suggDao = new SuggDao();
$suggQuery = $suggDao ->selectAll();
$suggInfo[] = "";
while($suggResult = mysqli_fetch_assoc($suggQuery)){
    $suggInfo[] = $suggResult;//将结果一条条存入
}

//查询回复
$respDao = new RespDao();
$respQuery = $respDao ->selectAll();
$respInfo[] = "";
while($respResult = mysqli_fetch_assoc($respQuery)){
    $respInfo[] = $respResult;//将结果一条条存入
}

$result=array(
    "sugg"=>$suggInfo,
    "resp"=>$respInfo
);

echo json_encode($result,JSON_UNESCAPED_UNICODE);